Вы используете локальные переменные в LINQ и используете let? 👇
Ключевое слово let позволяет вводить временную переменную прямо внутри запроса LINQ — как локальную переменную в цикле.
Разбивайте сложные вычисления на части
Делайте запрос модульнее и чище
Меньше проходов по данным → выше производительность
👉 Простой пример: csharp
from order in orders let total = order.Items.Sum(i => i.Price * i.Quantity) where total > 1000 let categories = order.Items.Select(i => i.Category).Distinct() select new { OrderId = order.Id, Total = total, Categories = categories };
let total = … — вычисляем сумму заказа только один раз
where total > 1000 — фильтруем по готовому значению
let categories = … — собираем уникальные категории
Вы используете локальные переменные в LINQ и используете let? 👇
Ключевое слово let позволяет вводить временную переменную прямо внутри запроса LINQ — как локальную переменную в цикле.
Разбивайте сложные вычисления на части
Делайте запрос модульнее и чище
Меньше проходов по данным → выше производительность
👉 Простой пример: csharp
from order in orders let total = order.Items.Sum(i => i.Price * i.Quantity) where total > 1000 let categories = order.Items.Select(i => i.Category).Distinct() select new { OrderId = order.Id, Total = total, Categories = categories };
let total = … — вычисляем сумму заказа только один раз
where total > 1000 — фильтруем по готовому значению
let categories = … — собираем уникальные категории
Telegram is riding high, adding tens of million of users this year. Now the bill is coming due.Telegram is one of the few significant social-media challengers to Facebook Inc., FB -1.90% on a trajectory toward one billion users active each month by the end of 2022, up from roughly 550 million today.
Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.